package com.seuic.hnapps.adapter;

import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.Button;
import android.widget.CompoundButton;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.seuic.hnapps.R;
import com.seuic.hnapps.bean.Select_subaccount_Bean;

import java.util.List;

public class Select_subaccount_adapter extends BaseQuickAdapter<Select_subaccount_Bean, BaseViewHolder> {
    String type;

    public Select_subaccount_adapter(int layoutResId, @Nullable List<Select_subaccount_Bean> data, String type) {
        super(layoutResId, data);
        this.type = type;
    }

    @Override
    protected void convert(@NonNull BaseViewHolder helper, Select_subaccount_Bean item) {
        helper.setText(R.id.select_subaccount_item_name, item.getName());
        helper.setText(R.id.select_subaccount_item_num, "定期子号" + item.getNum() + "");
        helper.setText(R.id.select_subaccount_item_money, item.getBalanceofAccount() + "");
        helper.setText(R.id.select_subaccount_item_upday, item.getValuedate()+"");
        helper.setText(R.id.select_subaccount_item_dueday, item.getDuedate()+"");
        helper.setText(R.id.select_subaccount_item_rate, item.getRateofinterest());
        Button button = helper.getView(R.id.select_subaccount_item_transitionbtn);
        if (type == "子账户") {
            button.setVisibility(View.INVISIBLE);
        }
        helper.addOnClickListener(R.id.select_subaccount_item_transitionbtn);

    }
}
